﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Fashion.Models
{
    public class SearchCriteria
    {
        FashionEntities1 FashionDB = new FashionEntities1();

        public List<string> Categories { get; set; }
        public List<string> Brands { get; set; }
        public string productName { get; set; }
        public string category { get; set; }
        public string price { get; set; }
        public string brandName { get; set; }
        public string rating { get; set; }
        public bool isLastest { get; set; }
        public DateTime startDate { get; set; }
        public DateTime endDate { get; set; }

        public SearchCriteria()
        {
            var categories = from category in FashionDB.Categories
                             select category.Name;
            var brands = from brand in FashionDB.Brands
                         select brand.BrandName;

            this.Brands = brands.ToList();
            this.Categories = categories.ToList();
        }

        public SearchCriteria(string product, string brand, string category, string price, string rating)
        {
            this.productName = product;
            this.brandName = brand;
            this.category = category;
            this.price = price;
            this.rating = rating;
        }
    }
}